﻿Public Class simple_calculator
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    End Sub

    Protected Sub btn_Calculate_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btn_Calculate.Click

        lbl_Result.Text = getResult(tb_FirstNumber.Text, tb_SecondNumber.Text)

    End Sub

    Private Function getResult(ByVal firstNumberStr As String, ByVal secondNumberStr As String) As String

        Dim firstNumber, secondNumber, result As Integer

        firstNumber = CInt(firstNumberStr)
        secondNumber = CInt(secondNumberStr)

        result = (firstNumber + secondNumber)

        Return CInt(result)

    End Function

End Class